package com.sunsy.authserver.asert;

import com.sunsy.authserver.enums.IApiErrorCode;
import com.sunsy.authserver.exception.ApiException;

import java.text.MessageFormat;

/**
 * api断言接口
 *
 * @author 孙思远
 * @date 2021/7/19
 */
public interface IApiAssert extends IAssert, IApiErrorCode {

  @Override
  default ApiException apiExc() {
    throw new ApiException(this);
  }

  @Override
  default ApiException apiExc(Object... args) {
    throw new ApiException(this, MessageFormat.format(this.getMsg(), args));
  }
}
